from rest_framework import serializers

from .models import User


# 用户注册序列化
class UserRegisterSerializer(serializers.ModelSerializer):
    class Meta:
        model = User
        fields = ['account', 'password', 'username', 'token', 'create_datetime']


# 用户登录序列化
class UserLoginSerializer(serializers.ModelSerializer):
    class Meta:
        model = User
        fields = ['id', 'account', 'username', 'avatar_url', 'role']

